<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

function goBack() {
  router.go(-1)
}

function goHome() {
  router.push('/')
}
</script>

<template>
  <div class="not-found">
    <h1>404</h1>
    <h2>页面未找到</h2>
    <p>抱歉，您访问的页面不存在或没有权限访问</p>
    <div class="buttons">
      <button @click="goBack" class="btn">返回上一页</button>
      <button @click="goHome" class="btn primary">返回首页</button>
    </div>
  </div>
</template>

<style scoped>
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  background-color: #f8f9fa;
}

h1 {
  font-size: 6rem;
  margin: 0;
  color: #42b883;
}

h2 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 2rem;
  color: #6c757d;
}

.buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.5rem 1.5rem;
  border: 1px solid #42b883;
  background-color: white;
  color: #42b883;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn:hover {
  background-color: #f1f1f1;
}

.btn.primary {
  background-color: #42b883;
  color: white;
}

.btn.primary:hover {
  background-color: #33a06f;
}
</style> 